import { FILTER_ACTIVE } from '../constants'

export default function filter(
  state = {
    active: 'all', // 默认高亮的
    list: ['all', 'active', 'completed'], // 列表
  },
  action
) {
  switch (action.type) {
    case FILTER_ACTIVE:
      return {
        ...state,
        active: action.item,
      }
    default:
      return state
  }
}
